package com.aceitunaproject.server.time.tick;

import java.io.Serializable;

import com.sun.sgs.app.ManagedObject;



/**
 * @author Federico Bergstein
 * 
 */
public interface TickManager extends ManagedObject,Serializable {

	/**
	 * Starts the ticking task, if the delay and duration have been set it uses
	 * them, otherwise uses default values
	 */
	void startTickTask();

	/**
	 * Sets the delay and duration properties and starts the ticking task
	 * @param delay The delay (in milliseconds) before the first run of the task.
	 * @param duration The duration(in milliseconds) of each tick.
	 */
	void startTickTask(int delay, int duration);

	/**
	 * The delay before the first run of the task.
	 * 
	 * @return delay time in minutes
	 */
	int getDelay();

	/**
	 * Sets the delay before the first run of the task.
	 * 
	 * @param delay
	 *            delay time in milliseconds
	 */
	void setDelay(int delay);

	/**
	 * Tick duration.
	 * 
	 * @return time in minutes
	 */
	int getTickDuration();

	/**
	 * Tick duration.
	 * 
	 * @param duration
	 *            duration of each tick in milliseconds
	 */
	void setTickDuration(int duration);

	/**
	 * Gets the current tick
	 * 
	 * @return the current tick
	 */
	double getCurrentTick();

}
